package com.heiye.count.biz.constants;

/**
 * @author: heiye
 * @date: 2025/04/15 下午5:09
 * @version: v1.0.0
 * @description: TODO
 */
public class RedisKeyConstants {

    /**
     * 问题维度计数 Key 前缀
     */
    private static final String COUNT_QUIZ_KEY_PREFIX = "count:quiz:";

    /**
     * Hash Field: 粉丝总数
     */
    public static final String FIELD_FANS_TOTAL = "fansTotal";

    /**
     * Hash Field: 关注总数
     */
    public static final String FIELD_FOLLOWING_TOTAL = "followingTotal";

    /**
     * 用户维度计数 Key 前缀
     */
    private static final String COUNT_USER_KEY_PREFIX = "count:user:";

    /**
     * Hash Field: 问题点赞总数
     */
    public static final String FIELD_LIKE_TOTAL = "likeTotal";

    /**
     * Hash Field: 问题发布总数
     */
    public static final String FIELD_QUIZ_TOTAL = "quizTotal";

    /**
     * Hash Field: 问题浏览总数
     */
    public static final String FIELD_BROWSE_TOTAL = "browseTotal";

    /**
     * Hash Field: 问题评论总数
     */
    public static final String FIELD_COMMENT_TOTAL = "commentTotal";

    /**
     * Hash Field: 问题最佳回答总数
     */
    public static final String FIELD_BEST_COMMENT_TOTAL = "bestCommentTotal";

    /**
     * 评论维度计数 Key 前缀
     */
    private static final String COUNT_COMMENT_KEY_PREFIX = "count:comment:";
    /**
     * 构建问题维度计数 Key
     *
     * @param quizId
     * @return
     */
    public static String buildCountQuizKey(Long quizId) {
        return COUNT_QUIZ_KEY_PREFIX + quizId;
    }

    /**
     * 构建用户维度计数 Key
     *
     * @param userId
     * @return
     */
    public static String buildCountUserKey(Long userId) {
        return COUNT_USER_KEY_PREFIX + userId;
    }

    /**
     * 构建评论维度计数 Key
     *
     * @param commentId
     * @return
     */
    public static String buildCountCommentKey(Long commentId) {
        return COUNT_COMMENT_KEY_PREFIX + commentId;
    }
}
